<!--
 * @Description: Document.prototype 
 * @Author: zzj
 * @Date: 2021-09-13 11:22:29
 * @LastEditors: zzj
 * @LastEditTime: 2021-09-13 12:04:05
-->

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document.prototype </title>
</head>
<body>
    <img src="/网易严选/images/礼物.png"  width="20px" alt="">
    <img src="/网易严选/images/美食.png"  width="20px" alt="">
    <a href="https://www.baidu.com/">百度一下</a>
    <p class="blue">p1:zzj学习document</p>
    <div>div:zzj学习document</div>
    <b>b:zzj学习document</b>
    <p>p2:zzj学习document</p>
    <ul>
        <li class="blue">zzj学习document1</li>
        <li id="red">zzj学习document2</li>
        <li>zzj学习document3</li>
    </ul>
    <script>
        var red = document.getElementById("red");
        red.style.backgroundColor = "red";
        var ps = document.getElementsByTagName("p");
        var ps_length = ps.length;
        for (var i=0;i<ps_length;i++){
            ps[i].style.fontSize = "24px";
        }
        
        var blues = document.getElementsByClassName("blue");
        var blues_length = blues.length;
        for (var i=0;i<blues_length;i++){
            blues[i].style.color = "blue";
        }
        //document.getElementsByTagName
        //获取到所有的name相同的元素(表单元素)

        //document
        //属性
        console.log(document.documentElement);  //HTML
        console.log(document.body);  //body
        console.log(document.doctype);  //返回版本信息
        console.log(document.title);  //网页标题
        console.log(document.URL);  //网址
        console.log(document.domain);  //域名  文件协议读不到，http协议可以读到
        console.log(document.referrer);  //从哪个页面跳转过来
        console.log(document.images);  //获取当前页面的所有img标签
        console.log(document.forms)  //获取当前页面的所有表单元素
        console.log(document.links);  //获取当前页面的所有A标签

        //方法
        
    </script>
</body>
</html>